package com.taptech.doufu.ui.view.topicview;

import android.content.Context;

import androidx.recyclerview.widget.GridLayoutManager;

/**
 * Created by Administrator on 2017/4/13/013.
 */
public class MeasuredGridLayoutManager extends GridLayoutManager {

    public MeasuredGridLayoutManager(Context context,int spanCount) {
        super(context,spanCount);
    }


    private boolean isScrollEnabled = true;

    public void setScrollEnabled(boolean flag) {
        this.isScrollEnabled = flag;
    }

    @Override
    public boolean canScrollVertically() {
        //Similarly you can customize "canScrollHorizontally()" for managing horizontal scroll
        return isScrollEnabled && super.canScrollVertically();
//        return false;
    }

    @Override
    public boolean canScrollHorizontally() {
        return isScrollEnabled &&  super.canScrollHorizontally();
    }
}
